import { getToken, request } from '@inbiz/utils';

const token = getToken();

// 设置当前指派
export async function setTask(params) {
  return request(`/edoc2Flow-web/process/operation/processAssignment?orgToken=${token}`, {
    method: 'post',
    data: params,
  });
}
// 设置将来指派
export async function setFutureTask(params) {
  return request(`/edoc2Flow-web/process/operation/processFutrueAssignment?orgToken=${token}`, {
    method: 'post',
    data: params,
  });
}

// 获取申请列表
export async function getApplyList(params?: any) {
  return request(
    `/inbiz/api/services/WorkFlowDoc/GetUserProcessApplications?userId=${params.userId}&token=${token}`,
    {
      method: 'get',
    },
  );
}

// 获取申请分类
export async function getApplyCategory(params: any) {
  return request(`/edoc2Flow-web/edoc-task/getTaskGroupByUserId`, {
    method: 'POST',
    data: {
      ...params,
      orgToken: token,
      type: 'apply',
      groupType: 'Group',
    },
    requestType: 'form',
  });
}
